<template>
  <div id="wrap" v-wechat-title="this.title">
    <img src="static/wximg/login/bg.png" alt="" width="100%">
    <div id="qiche" class="qiche"><img src="static/wximg/login/logo.png" alt="" width="80%">
    </div>
    <div class="divider"></div>
    <form id="search_mini_form" action="static/wx/doclogin/login.html" method="post">
      <div class="item email">
        <input type="text" id="userName" name="userName" placeholder="请输入用户名..." size="12">
      </div>
      <div class="item passwd">
        <input type="password" id="passWord" name="passWord" placeholder="请输入密码..." size="12">
      </div>
      <br/>
      <table width="100%">
        <tr>
          <td width="4%"></td>
          <td colspan="3"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <img src="static/wximg/login/ck.png" style="width:1rem"> <label style="font-size: 16px">记住密码</label></td>
        </tr>
        <tr>
          <td width="4%"></td>
          <td>
            <button @click="submitlogin" type="button" class="button">登陆</button>
            <!-- <div class="rmbtn" tapmode="buyhover" onclick="qqlogin()">
                qq登 录
            </div> -->
          </td>
          <td width="4%"></td>
        </tr>
      </table>
    </form>
  </div>
</template>
<script>
  import Qs from 'qs'//引入qs
  export default {
    name: "login",
    data() {
      return {
        title: "医生登陆"
      }
    },
    methods: {
      submitlogin: function () {
        let prm = {
          userName: $$("#userName").val(),
          passWord: $$("#passWord").val()

        }

        this.$axios.post('wx/doclogin/login.json', Qs.stringify(prm)).then(function (response) {
          if (response.data.code == 1) {
            this.$router.push({name: 'home', params: {userId: 123}});
          } else {
            alert("登陆失败");
          }
        }.bind(this)).catch(function (error) {
          console.log(error);
        });
        //  this.$axios.post('wx/doclogin/login.json',Qs.stringify(prm));


      }

    }
  }

</script>
<style lang="less">
  html {
    height: 100%;
  }

  /*     body {
           background: url(image/bg.png) no-repeat center;
       }*/

  .divider {
    height: 1px;
  }

  .qiche {
    margin-top: -160px;
    text-align: center;
    padding-top: 100px;
    padding-bottom: 40px;
    margin-left: 3rem;
    width: 80%;
  }

  .qiche img {
    width: 40%;
  }

  .email input {
    height: 42px;
    margin-left: 38px;
    font-size: 16px;
    color: #8E8C8C;
    width: 75%;
    outline: none;
    border: 0px;
    border-bottom: #cccbc9 1px solid;
  }

  .passwd input {
    height: 42px;
    margin-left: 38px;
    font-size: 16px;
    color: #8E8C8C;
    width: 75%;
    outline: none;
    border: 0px;
    border-bottom: #cccbc9 1px solid;
  }

  .passwd img,
  .email img {
    vertical-align: top;
  }

  .item {
    position: relative;
    border-radius: 24px;
    margin: 10px 20px;
  }

  .email img {
    width: 31px;
    margin-top: 9px;
    margin-left: 15px;
    margin-right: 4px;
  }

  .passwd img {
    width: 31px;
    margin-top: 9px;
    margin-left: 15px;
    margin-right: 4px;
  }

  .bottom {
    width: 100%;
    text-align: center;
    /*padding-bottom: 20px;*/
    font-size: 12px;
  }

  .bottom img {
    height: 50px;
  }

  .bottom .arrow {
    text-align: center;
    margin: 10px 0;
  }

  .bottom .arrow img {
    width: 40px;
    height: 20px;
  }

  #qqpic {
    margin-right: 10px;
    margin-left: 10px;
  }

  .rmbtn {


  }

  .button {
    display: inline-block;
    padding: 15px 25px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 35px;
    width: 75%;
    text-align: center;
    text-decoration: none;
    outline: none;
    color: #009fff;
    background-color: #fff;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px #F3F3F3;
  }

  .button:hover {
    background-color: #fff
  }

  .button:active {
    background-color: #fff;
    box-shadow: 0 2px #F3F3F3;
    transform: translateY(4px);
  }
</style>
